#!/usr/bin/env python3
# coding: utf-8

import numpy as np
import cv2 as cv

img = np.zeros((512,512,3),np.uint8)
cv.line(img,(0,0),(510,510),(255,0,0),2)
cv.rectangle(img,(100,100),(300,300),(0,255,0),2)
cv.circle(img,(250,250),100,(0,0,255),-1)
cv.ellipse(img,(100,100),(100,50),0,0,180,255,-1)
font = cv.FONT_HERSHEY_SIMPLEX
cv.putText(img,'hello opencv',(10,500),font,2,(255,255,255),2,cv.LINE_8)

winName='opencv example'
cv.namedWindow(winName)
while True:
    cv.imshow(winName,img)
    key = cv.waitKey(0) & 0xff
    if key == ord('q'):
        break

cv.destroyWindow(winName)